package com.java2007.service;

import com.java2007.pojo.Food;
import com.java2007.pojo.FoodType;

import java.sql.SQLException;
import java.util.List;

/**
 * 菜品业务层
 * @author ZOU
 */
public interface FoodService {

    /**
     * 查询全部
     * @return
     * @throws SQLException
     */
    List<Food> findAll() throws SQLException;

    /**
     * 根据名字查询
     * @param foodName
     * @return
     * @throws SQLException
     */
    List<Food> findByFoodName(String foodName) throws SQLException;

    /**
     * 根据ID删除
     * @param foodId
     * @return
     * @throws SQLException
     */
    int deleteByFoodId(int foodId)throws SQLException;

    /**
     *
     * 增加
     * @param food
     * @return
     * @throws SQLException
     */
    int saveFood(Food food)throws SQLException;

    /**
     * 更新
     * @param food
     * @return
     * @throws SQLException
     */
    int updata(Food food)throws SQLException;

    /**
     * 通过ID查询
     * @param foodId
     * @return
     * @throws SQLException
     */
    Food findByFoodId(int foodId)throws SQLException;
}
